
package com.utils;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

public class ResponseUtils {
	public static void writeMessage(HttpServletResponse response,String message,String path) throws IOException {
		response.setContentType("text/html;charset=utf-8");
		PrintWriter out=response.getWriter();		
		out.println("<script>alert('"+message+"');location.href='"+ path +"'</script>");	
		out.flush();
		out.close();
	}
	public static void writeMessage(HttpServletResponse response,String path) throws IOException {
		response.setContentType("text/html;charset=utf-8");
		PrintWriter out=response.getWriter();
		out.println("<script>location.href='"+ path +"'</script>");
		out.flush();
		out.close();
	}
	public static void writeHTML(HttpServletResponse response,String message) throws IOException {
		response.setContentType("text/html;charset=utf-8");
		PrintWriter out=response.getWriter();		
		out.write(message);
		out.flush();
		out.close();
	}
}
